//导出
import { mapState } from 'vuex';

export const mixinUtils =  {
	data () {
		return {
		
		}
	},
	computed:{
	
	},
	created () {
	
	},
	methods: {
		
		//确认框
		confirm( title = '确认要进行这个操作吗' , callback,) {
			this.$confirm(title, '提示', {
				confirmButtonText: '确定',
				cancelButtonText : '取消',
				type             : 'warning',
			}).then(() => {
				callback()
			}).catch(() => {
			
			});
		},
		//通知
		notify(title,message,type='info',time=2000){
			switch (type) {
				case 'success':
					this.$notify({
						title: title,
						message: message,
						type: 'success',
						duration:time
					});
					break;
				case 'error':
					this.$notify.error({
						title: title,
						message: message,
						duration:time
					});
					break;
				case 'warning':
					this.$notify({
						title: title,
						message: message,
						type: 'warning',
						duration:time
					});
					break;
				case 'info':
					this.$notify.info({
						title: title,
						message: message,
						duration:time
					});
					break;
				default:
				
			}
		},
		jump(url){
			this.$router.push(url)
		}
	},
	filters:{
	
	},
}
